home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / WINDOWS / CLIPST.ARJ / CSAPI.TXT < prev    next >
Text File  |  1992-05-24  |  3KB  |  91 lines

  1. The ClipStac API
  2. ===================
  3.  
  4. You can use the API by registering the following messages via the
  5. Windows' RegisterMessage function.
  6.  
  7. Please see the file CSAPI.H.
  8.  
  9. Messages sent to ClipStac:
  10. --------------------------
  11.  
  12. SendMessage(0xffff,WM_CLIPSTACREGISTER,your_hWnd,0L); 
  13.     Send this message to initiate a ClipStac conversation.
  14.     hWnd = 0xffff
  15.     msg = WM_CLIPSTACREGISTER
  16.     wParam = your_hWnd
  17.     lParam = 0L
  18.  
  19.     Send this message to 0xffff to broadcast the message to every desktop
  20.     window. If ClipStac is running, it will respond by Posting the same
  21.     message back to you with wParam=0, LOWORD(lParam)=ClipStac's hWnd, and
  22.     HIWORD(lParam)=your hWnd.
  23.     
  24.     Beware, however, that this will also send a WM_CLIPSTACREGISTER to
  25.     your own program, so check the lParam to filter this out.
  26.     
  27. BOOL SendMessage(hWndClipStac,WM_CLIPSTACPUSH,0,0L);
  28.     Pushes the current Clipboard contents onto the top of the Stack
  29.     (ClipStack[0]), and returns TRUE if successful, FALSE if not 
  30.         
  31. BOOL SendMessage(hWndClipStac,WM_CLIPSTACPOP,index,0L);
  32.     Pops the contents of ClipStack[index] off the Stack and into the
  33.     Clipboard. The index should be a valid ClipStack index. Returns TRUE
  34.     if successful, FALSE if not.
  35.  
  36. int SendMessage(hWndClipStac,WM_CLIPSTACFIND,0,LPSTR);
  37.     Finds the first stack item that contains LPSTR in its identifying info.
  38.     If found, returns the index of that item, otherwise -1. 
  39.  
  40. LPSTR SendMessage(hWndClipStac,WM_CLIPSTACGET,index,0L);
  41.     Returns the identifying info of a stack item from ClipStack[index]. The
  42.     return value is LPSTR or NULL.
  43.  
  44. void SendMessage(hWndClipStac,WM_CLIPSTACDEREGISTER,0,0L);
  45.     Send this message when your program is about to terminate (or whenever
  46.     you have finished using ClipStac's services) so that ClipStac will 
  47.     remove your hWnd from its internal list.
  48.  
  49. int SendMessage(hWndClipStac,WM_CLIPSTACNUMITEMS,0,0L);
  50.     Send this message to find out how many items are in ClipStac's list.
  51.  
  52.  
  53. Messages received from ClipStac:
  54. --------------------------------
  55.  
  56. WM_CLIPSTACEXIT - ClipStac will send this message to your program if ClipStac
  57.     is about to terminate, provided that you previously registered yourself
  58.     with WM_CLIPSTACREGISTER.
  59.  
  60. WM_CLIPSTACREGISTER - ClipStac will post this message to your program if
  61.     your program first sends the same message with its hWnd as the wParam.
  62.     ClipStac's reply will have wParam=0, LOWORD(lParam)=ClipStac's hWnd,
  63.     and HIWORD(lParam)=your hWnd.
  64.  
  65. ============================
  66.  
  67. THE CSTEST.CPP PROGRAM
  68. ------------------------
  69.  
  70. CSTEST.CPP is a program that tests the ClipStac API. To use it, first make
  71. sure something is in the Clipboard (text or bitmap).
  72.  
  73. If you run CSTEST.EXE without first loading ClipStac, CSTEST will wait a
  74. few seconds and then warn you that "ClipStac was not found." It does this
  75. by attempting to register itself with ClipStac, and when that fails, exiting.
  76.  
  77. If you run CSTEST after loading ClipStac, it will:
  78.  
  79. -Register the ClipStac API messages defined in CSAPI.H.
  80. -Register itself with ClipStac.
  81. -Push the Clipboard contents onto the ClipStac stack.
  82. -Pop the item in ClipStac[0] into the Clipboard.
  83. -Retrieve the identifying info on ClipStac[0].
  84. -Find the ClipStac item that corresponds to that info.
  85. -DeRegister itself with ClipStac and exit.
  86.  
  87. =================
  88.  
  89.  
  90.  
  91.